package xj.service.backstage;

import java.util.List;

import xj.model.SysUser;



public class LoginService {
	
	public SysUser loginCheck(String usercode, String password) {
		List<SysUser> list = SysUser.dao.find("select * from sys_user where usercode=?", usercode);
		if (list.size() != 1) {
			return null;
		}
		
		SysUser sysUser = list.get(0);
		if (sysUser != null && password.equals(sysUser.getStr("password"))) {
			return sysUser;
		} 
		
		return null;
	}
}
